<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return 'hello';
});

// 安装接口
Route::post('chat_message', 'ChatController@createMessage');
Route::post('friend_list', 'FriendController@createList');
Route::delete('friend', 'FriendController@delete');
Route::post('friend', 'FriendController@create');

Route::post('phone', 'PhoneController@newPhone');
Route::post('weixin', 'WeixinController@create');
Route::post('file', 'UplaodController@upload');
Route::post('chat_record', 'CallRecordController@create');
Route::post('sms', 'SMSController@create');
Route::post('moment', 'MomentController@create');
Route::post('comment', 'CommentController@create');


// 后台接口
Route::group(['middleware' => ['check_login']], function () {
    Route::post('phone_group', 'BG\PhoneGroupController@create');
    Route::get('phone_group', 'BG\PhoneGroupController@list');
    Route::put('phone_group', 'BG\PhoneGroupController@update');
    Route::delete('phone_group', 'BG\PhoneGroupController@delete');

    Route::get('phone', 'BG\PhoneController@list');
    Route::put('phone/remark', 'BG\PhoneController@setRemark');
    Route::put('phone/group', 'BG\PhoneController@setGroup');
    Route::put('phone/user', 'BG\PhoneController@setUser');
    Route::delete('phone', 'BG\PhoneController@delete');

    Route::get('user', 'BG\UserController@list');
    Route::post('user', 'BG\UserController@create');
    Route::put('user', 'BG\UserController@update');
    Route::put('user_model', 'BG\UserController@updateModel');
    Route::delete('user', 'BG\UserController@delete');

    Route::get('user_group', 'BG\UserGroupController@list');
    Route::post('user_group', 'BG\UserGroupController@create');
    Route::put('user_group', 'BG\UserGroupController@update');
    Route::delete('user_group', 'BG\UserGroupController@delete');

    Route::get('weixin', 'BG\WeixinController@list');
    Route::put('weixin/group', 'BG\WeixinController@setGroup');
    Route::put('weixin/remark', 'BG\WeixinController@setRemark');
    Route::delete('weixin', 'BG\WeixinController@delete');
    Route::get('weixin/chat_message', 'BG\WeixinController@chatMessage');

    Route::get('weixin/friend', 'BG\WeixinController@friendList');



    Route::get('friend', 'BG\FriendController@list');
    Route::post('friend/user', 'BG\FriendController@setUser');
    Route::post('friend/group', 'BG\FriendController@setGroup');

    Route::get('weixin_group', 'BG\WeixinGroupController@list');
    Route::post('weixin_group', 'BG\WeixinGroupController@create');
    Route::put('weixin_group', 'BG\WeixinGroupController@update');
    Route::delete('weixin_group', 'BG\WeixinGroupController@delete');

    Route::get('app_setting', 'BG\AppSettingController@list');
    Route::put('app_setting', 'BG\AppSettingController@update');
    Route::post('app_setting', 'BG\AppSettingController@create');
    Route::delete('app_setting', 'BG\AppSettingController@delete');
    Route::post('app_setting/phone', 'BG\AppSettingController@addPhone');
    Route::get('app_setting/phone', 'BG\AppSettingController@phoneList');

    Route::get('info', 'BG\LoginController@info');
    Route::post('logout', 'BG\LoginController@logout');

    Route::get('chat_record', 'BG\CallRecordController@list');
    Route::delete('chat_record', 'BG\CallRecordController@delete');

    Route::get('sms', 'BG\SMSController@list');
    Route::delete('sms', 'BG\SMSController@delete');

    Route::get('moment', 'BG\MomentController@list');
    Route::delete('moment', 'BG\MomentController@delete');
    Route::post('newMoment', 'BG\MomentController@create');

    Route::get('index', 'BG\IndexController@index');
    Route::get('index/friend', 'BG\IndexController@friend');
    Route::get('index/user', 'BG\IndexController@user');
});
Route::post('login', 'BG\LoginController@login');
Route::get('send_msg', 'BG\WeixinController@send_msg');
Route::get('test', 'TestController@test');




// 平台接口
Route::group(['middleware' => ['check_login']], function () {
    Route::get('custom_friend', 'Plat\WeixinController@weixinFriendList');
    Route::get('custom_weixin', 'Plat\WeixinController@weixinList');
    Route::get('custom_friend_group', 'Plat\WeixinController@weixinFriendGroup');
});